import { get, post, put } from '../../../utils/request'
import { AddParams, AddResult, ListParams, ListResult } from './type'

export const getReserveList = (data: ListParams) => {
  return get<ListParams, ListResult>("/api/reservation/list", data);
};

export const addReserve = (data: AddParams) => {
  return post<AddParams, AddResult>('/api/reservation/add', data)
}

//获取单条
export const getReserveModel = (id: number) => {
  return get<number, AddResult>(`/api/reservation/get/${id}`);
}

//修改
export const updateReserve = (data: AddParams) => {
  return put<AddParams, AddResult>('/api/reservation/update', data);
}

//批量删除
export const delAll = (ids: number[]) => {
  return post<number[], null>('/api/reservation/deleteAll', ids)
}